#include <iostream>
#include <vector>
#include <cmath>
#include <iomanip>

using namespace std;

class Rectangle
{
public:
    int x1, y1, x2, y2;
    double myDis, myArea;

    Rectangle(int x1, int y1, int x2, int y2) : x1(x1), y1(y1), x2(x2), y2(y2)
    {
        myDis = 0;
        myArea = 0;
    }

    void getLength()
    {
        myDis = sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
    }

    void getArea()
    {
        myArea = (x1 - x2) * (y1 - y2);
    }

    void getResult()
    {
        cout << fixed << setprecision(3) << myDis << " ";
        cout << fixed << setprecision(0) << round(myArea) << endl;
    }
};

int main(int argc, char const *argv[])
{
    vector<Rectangle> vec;
    vector<Rectangle>::iterator iter;

    int x1, x2, y1, y2;

    int count;
    cin >> count;

    for (int i = 0; i < count; i++)
    {
        cin >> x1 >> y1 >> x2 >> y2;
        vec.emplace_back(x1, y1, x2, y2);
    }

    for (iter = vec.begin(); iter != vec.end(); ++iter)
    {
        iter->getLength();
        iter->getArea();
        iter->getResult();
    }

    return 0;
}
